#include "HouseCube.h"

using namespace Ogre;

HouseCube::HouseCube(Ogre::Vector3 location, GridNode* g, Ogre::MeshPtr cubePtr, int iD) : Cube(location, "HouseCube", g, cubePtr, iD)
{
	//MaterialPtr mat = MaterialManager::getSingleton().create("HouseCubeMat", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
	//mat->setDiffuse(0.5f, 0.5f, 0.5f, 1.0f);
	//mat->setAmbient(0.5f, 0.5f, 0.5f);

	//mCubeEntity->setMaterial( mat );

	
	mCubeEntity->setMaterialName("HouseCube");
	// mCubeEntity->setMaterial(matManager->getMaterial(MatManager::HOUSE_CUBE_MAT))
	///// enum { NO_MAT = 0, HOUSE_CUBE_MAT)
	///// MatManager myManager = MatManager.getInstance();
	///// (design pattern singleton)
	///// myManager->addMaterial("coolmat.material");
	///// set materials inside myManager
	///// addMaterial: materials.add(INT)
    
	int timerID = (-1) * iD;// making a new cube, so it needs its own unique iD... 
							//since it's just negative the house iD, we can match it easily to the house
	timer = new HouseTimer(location, g, cubePtr, timerID);

	Ogre::Real time = 0.00;
	//timer->setTime(time);
}

void HouseCube::setHouseTime(Ogre::Real time)
{
	timer->setTime(time);
}

void HouseCube::update(Ogre::Real deltaTime)
{
	timer->update(deltaTime);
}